/**
 * 文件挂接api
 */
import request from '@/utils/request'

// export function login (data) {
//   return request({
//     url: '/user/login',
//     method: 'post',
//     data
//   })
// }


/**
 *  查看树形模板
 * @param {*} obj 
 * @returns 
 */
export function initTemplateTree(obj = { way: 1 }) {
  var valueObj = new Object();
  valueObj.valueMap = obj
  var params = encodeURIComponent(JSON.stringify(valueObj));
  console.log(params)
  return request({
    url: '/request/arcService/initTemplateTree.jspx',
    method: 'get',
    json: true,

  })
}


/**
 *  查询后台mobilequery
 * @param {*} _typeid  
 * @param {*} paramObj 
 * @returns 
 */
export function mobilequery(_typeid,paramObj) {
  var valueObj = new Object();
  valueObj.valueMap = paramObj
  var params = encodeURIComponent(JSON.stringify(valueObj));
  console.log(params)
  return request({
    url: `/mobilequery/${_typeid}.jspx`,
    method: 'post',
    json: true,
    body: { remote_args: params }
  })
}

/**
 * 保存数据
 * @param {*} obj 表单数据
 * @returns 
 */
export function save(obj) {
  var valueObj = new Object();
  valueObj.valueMap = obj
  var params = encodeURIComponent(JSON.stringify(valueObj));
  console.log(params)
  return request({
    url: '/trans/hookbatchService/save.jspx',
    method: 'post',
    json: true,
    body: { remote_args: params }
  })
}
export function message() {
  return request({
    url: '/message',
    method: 'get'
  })
}
